package com.ccc.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.OneToOne;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Product entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "product")
public class Product implements java.io.Serializable {

	// Fields

	private Integer productId;
	private String productName;
	private Integer rdCost;
	private Integer rdCycle;
	private Integer productionCost;
	private Integer productionCycle;
	private Integer productVol;
	private Integer stockCost;
	private Set<Line> line;

	@OneToMany(cascade=CascadeType.ALL,mappedBy="product")
	public Set<Line> getLine() {
		return line;
	}

	public void setLine(Set<Line> line) {
		this.line = line;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "productId", unique = true, nullable = false)
	public Integer getProductId() {
		return this.productId;
	}

	public void setProductId(Integer productId) {
		this.productId = productId;
	}

	@Column(name = "productName", nullable = false, length = 50)
	public String getProductName() {
		return this.productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	@Column(name = "rdCost", nullable = false)
	public Integer getRdCost() {
		return this.rdCost;
	}

	public void setRdCost(Integer rdCost) {
		this.rdCost = rdCost;
	}

	@Column(name = "rdCycle", nullable = false)
	public Integer getRdCycle() {
		return this.rdCycle;
	}

	public void setRdCycle(Integer rdCycle) {
		this.rdCycle = rdCycle;
	}

	@Column(name = "productionCost", nullable = false)
	public Integer getProductionCost() {
		return this.productionCost;
	}

	public void setProductionCost(Integer productionCost) {
		this.productionCost = productionCost;
	}

	@Column(name = "productionCycle", nullable = false)
	public Integer getProductionCycle() {
		return this.productionCycle;
	}

	public void setProductionCycle(Integer productionCycle) {
		this.productionCycle = productionCycle;
	}

	@Column(name = "productVol", nullable = false)
	public Integer getProductVol() {
		return this.productVol;
	}

	public void setProductVol(Integer productVol) {
		this.productVol = productVol;
	}

	@Column(name = "stockCost", nullable = false)
	public Integer getStockCost() {
		return this.stockCost;
	}

	public void setStockCost(Integer stockCost) {
		this.stockCost = stockCost;
	}

}